/**
 * @Company: 北京慧点科技有限公司 | www.smartdot.com.cn
 * @Copyright 1998-2020 © Smartdot Technologies Co., Ltd.
 */
package com.springlearn.zhoufei.other.spring.demo2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class HelloWorld4 {
    @Autowired
    @Qualifier("HelloWorld3_1")
    private HelloWorld3 helloWorld3;
    public void sayHelloWorld() {
        System.out.println(helloWorld3.toString());
    }
    
    public static void main(String[] args) {
        String pathHello = "./other\\Bean2.xml";
        AbstractApplicationContext context = new ClassPathXmlApplicationContext(pathHello);
        HelloWorld4 HelloWorld4 = (HelloWorld4) context.getBean("HelloWorld4");
        HelloWorld4.sayHelloWorld();
    }
}